//
//  ZHttpClient.h
//  ZFramework
//
//  Created by liuchengbin on 15/5/9.
//  Copyright (c) 2015年 liuchengbin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"

typedef enum
{
    ZHttpResponseType_Json,
    ZHttpResponseType_JqueryJson,
    ZHttpResponseType_XML,
    ZHttpResponseType_Common
}ZHttpResponseType;

@interface ZHttpClient : AFHTTPRequestOperationManager


- (void)requestWithURL:(NSString *)url
                 paras:(NSDictionary *)parasDict
                  type:(ZHttpResponseType)type
                allowFetchCache:(BOOL)allowFetchCache
               success:(void(^)(AFHTTPRequestOperation* operation, NSObject *resultObject))success
               failure:(void(^)(NSError *requestErr))failure ;
- (void)iconImagesWithURL:(NSString *)url
                      paras:(NSDictionary *)parasDict
                     images:(NSArray*)images
                    success:(void(^)(AFHTTPRequestOperation* operation, NSObject *resultObject))success
                    failure:(void(^)(NSError *requestErr))failure
             uploadProgress:(void(^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))uploadProgress;
- (void)uploadImageWithURL:(NSString *)url
                      paras:(NSDictionary *)parasDict
                     images:(NSArray*)images
                    success:(void(^)(AFHTTPRequestOperation* operation, NSObject *resultObject))success
                    failure:(void(^)(NSError *requestErr))failure
             uploadProgress:(void(^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))uploadProgress;
- (void)uploadImageWithURL:(NSString *)url
                     paras:(NSDictionary *)parasDict
                     cover:(UIImage*)cover
                    images:(NSArray*)images
                   success:(void(^)(AFHTTPRequestOperation* operation, NSObject *resultObject))success
                   failure:(void(^)(NSError *requestErr))failure
            uploadProgress:(void(^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))uploadProgress;
-(void)cancel;
@end
